package com.tjl.freme.daoImpl;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.tjl.frame.entity.Authority;
import com.tjl.freme.dao.AuthorityDao;

@Repository("AuthorityDao")
public class AuthorityDaoImpl implements AuthorityDao {

	@Resource
	private SessionFactory sessionFactory;
	@Override
	public void save(Authority Object) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(Authority Object) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(Authority Object) throws Exception {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<Authority> findAll() throws Exception {
		String hql = "from Authority c";
		Session session = sessionFactory.getCurrentSession();
		Query query = session.createQuery(hql);
		return query.list();
	}

}
